refactor(base): Use PossiblyRedactedStateEventContent bound in MinimalStateEvent#6088
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6088 +/- ##
==========================================
+ Coverage 89.83% 89.90% +0.06%
==========================================
Files 360 360
Lines 99873 99789 -84
Branches 99873 99789 -84
==========================================
- Hits 89723 89712 -11
+ Misses 6641 6575 -66
+ Partials 3509 3502 -7 ☔ View full report in Codecov by Sentry. |
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
|
f955c94 to
2989dfe
Compare
| #[serde( | ||
| bound(serialize = "C: Serialize + Clone"), | ||
| from = "MinimalStateEventSerdeHelper<C>", | ||
| into = "MinimalStateEventSerdeHelper<C>" |
There was a problem hiding this comment.
Note: I would have preferred to be able to serialize this directly without a tag, but for some reason applying #[serde(untagged)] on a variant of the deserialization helper makes the deserialization of the join rules content fail.
…lStateEvent We usually don't care if the event was redacted or not, we usually want to no whether a field is set or not, so we don't need `Original` and `Redacted` variants. This simplifies several parts of the code since we don't have to handle the intermediate enum to access the content now. Due to new APIs in Ruma we can also just convert original and redacted event contents to possibly redacted event contents. Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2989dfe to
e5005b7
Compare
poljar
left a comment
There was a problem hiding this comment.
As far as I understand this looks good.
We usually don't care if the event was redacted or not, we usually want to know whether a field is set or not, so we don't need
OriginalandRedactedvariants.This simplifies several parts of the code since we don't have to handle the intermediate enum to access the content now. Due to new APIs in Ruma we can also just convert original and redacted event contents to possibly redacted event contents.
This should allow further code removal in a follow-up PR, by allowing to use the same code to handle
Sync*andStripped*events inRoomInfo.The backwards-compatible deserialization of
MinimalStateEventwas verified in a client with Fractal.